//
//  YYGWebview.h
//  YiYuanGou
//
//  Created by zhangtongle on 2017/5/5.
//  Copyright © 2017年 同乐1234521. All rights reserved.
//

#import <UIKit/UIKit.h>

#import <JavaScriptCore/JavaScriptCore.h>

@protocol JSObjectDelegate <JSExport>
- (void)openUrl:(NSString *)jsonStr;
- (void)setPageInfo:(NSString *)jsonStr;
- (void)setShareInfo:(NSString *)jsonStr;
- (void)wxPay:(NSString *)jsonStr;
- (void)wxCharge:(NSString *)jsonStr;
- (void)wxLogin;
- (void)deviceInfo;
- (void)callQQ:(NSString *)jsonStr;
@end


@protocol YYGWebViewDelegate <NSObject>

//- (void)openNewWindow:(NSString *)urlStr;

//- (void)webView:(UIWebView *)webView wxShare:(NSString *)shareInfo;
//- (void)webView:(UIWebView *)webView wxPay:(NSString *)orderInfo;
//- (void)webView:(UIWebView *)webView wxCharge:(NSString *)orderInfo;
//- (void)webView:(UIWebView *)webView wxLogin:(NSString *)loginInfo;
@end

@interface YYGWebview : UIView <JSObjectDelegate>

@property (weak, nonatomic) IBOutlet NSLayoutConstraint *navHeight;
@property (weak, nonatomic) IBOutlet UIButton *navBackBtn;
@property (weak, nonatomic) IBOutlet UILabel *navTitleL;
@property (weak, nonatomic) IBOutlet UIButton *navShareBtn;

@property (assign, readonly, nonatomic) BOOL isMainWebView;


- (void)navHidden:(BOOL)hidden;
- (void)setMainWebView;

/**
 显示加载进度条
 */
- (void)enableNavigationProgress;

+ (YYGWebview *)yygWebView:(CGRect)frame;
- (void)loadRequest:(NSString *)urlStr;
@end
